package com.tentact.controller;

import com.tentact.Service.EmpService;
import com.tentact.Service.addEmpService;
import com.tentact.pojo.T_User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping(value = "/dc")
public class EmpListController {
    @Autowired
    private EmpService empService;
    @RequestMapping(value = "/ftb" ,method = RequestMethod.GET)
    @ResponseBody
    public List<T_User> empController(String userName){
        System.out.println("userName = " + userName);
        List<T_User> tUsers = empService.empsearch(userName);
        return tUsers;
    }
    //添加按钮

//    @RequestMapping(value = "/ac", method = RequestMethod.POST)
//    @ResponseBody
//    public String addEmpController(T_User t_user){
//        //对象接受
//        System.out.println(t_user.getId());
//        String tuser=  empService.addEmpinsert(t_user);
//
//        return tuser;
//
//    }



}
